home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Invisible Universe
/
Invisible Universe (1995)(Voyager)[Mac-PC].iso
/
mac
/
UNIVERSE
/
SHARED.DIR
/
01021_Script_Menu code
< prev
next >
Wrap
Text File
|
1995-11-21
|
11KB
|
468 lines
on showOverheadMenu
global gOverheadMenuP, gMenuVolume
if the machineType = 256 then
runPCMenuBar
else
set gOverheadMenuP = 1
installMenu cast "Main Overhead Menu"
set the checkMark of menuItem (gMenuVolume + 1) of menu "volume" = 1
end if
end showOverheadMenu
on runPCMenuBar
global gMenuVolume
set curSel = 0
set h = 0
set w = 30
if the mouseH < h+w then set cn = the number of cast "Menu1"
else
set h = h+w
set w = 70
if the mouseH < h+w then set cn = the number of cast "Menu2"
else
set h = h+w
set w = 61
if the mouseH < h+w then
set cn = the number of cast "Menu3"
set curSel = gMenuVolume+2
end if
end if
end if
if voidP(cn) then exit
set cnTemp = the number of cast "temp menu"
copyToClipBoard cast cn
pasteClipBoardInto cast cnTemp
set the name of cast cnTemp = "temp menu"
copyToClipBoard cast (cn+1)
pasteClipBoardInto cast (cnTemp+1)
set the name of cast (cnTemp+1) = "temp menua"
set cn = cnTemp
set sel = doDMDPopMenu2(cn, h, h+w, 1, curSel)
-- --put ">>> runPCMENUBar sel = " sel
if sel > 1 then
set command = line (sel - 1) of field (cnTemp+1)
-- --put ">>>" & command
do command
end if
end runPCMenuBar
on hideOverheadMenu
global gOverheadMenuP
-- if the stageTop <> 0 then exit
set gOverheadMenuP = 0
if the machineType <> 256 then installMenu 0
end hideOverheadMenu
on testOverheadMenu
global gOverheadMenuP
if char 1 of the movie = "_" then exit
if the machineType <> 256 then
--
--
-- Macs
--
if the stageTop <> 0 then
if the mouseV < 0 then
if not gOverheadMenuP then
showOverheadMenu
end if
else if gOverheadMenuP then hideOverheadMenu
exit
end if
--
--
-- If the mouse is between 0 and 20 for more than a second -- TBD timing
-- bring up the overhead menu
--
if the mouseV < -1 or the mouseV > 20 then
if gOverheadMenuP then hideOverheadMenu
exit
else
if not gOverheadMenuP then showOverheadMenu
end if
else
--
--
-- PCs
--
if the mouseH > 0 and the mouseV >= 0 and the mouseV <= 20 then showOverheadMenu
end if
end testOverheadMenu
on changeVolume newVol
global gVolume, gMenuVolume
if the machineType <> 256 then
set the checkMark of menuItem (gMenuVolume + 1) of menu "volume" = 0
set gMenuVolume = newVol
set the checkMark of menuItem (gMenuVolume + 1) of menu "volume" = 1
else
set gMenuVolume = newVol
end if
set gVolume = getAt([0, 7, 15, 22, 31, 44, 63, 80, 127, 180, 255], gMenuVolume+1)
if the type of sprite 10 = 16 then
set cn = the castNum of sprite 10
if the castType of cast cn = #digitalVideo then set the volume of sprite 10 = gVolume
end if
if the type of sprite 12 = 16 then
set cn = the castNum of sprite 12
if the castType of cast cn = #digitalVideo then set the volume of sprite 12 = gVolume
end if
if the type of sprite 48 = 16 then
set cn = the castNum of sprite 48
if the castType of cast cn = #digitalVideo then set the volume of sprite 48 = gVolume
end if
end changeVolume
on goGOMain
hideOverheadMenu
updateStage
if the movie = "TOUR.DIR" then stopTour
else if the movie = "MOVIES.DIR" then stopMovies
if the frameLabel <> "TOCM" then goGo("TOCM")
end goGOMain
--
--
-- Go to a major section from the menu BUT, if we are
-- at the main TOCM screen, then do the morph first.
--
on goGOm theLabel
hideOverheadMenu
updateStage
if the movie = "TOUR.DIR" then stopTour
else if the movie = "MOVIES.DIR" then stopMovies
if theLabel = the frameLabel then exit
if theLabel&"M" = the frameLabel then exit
if (the movie = "TOC.DIR") and (theLabel = "P") and ((char 1 of the frameLabel) = "P") then exit
--
--
-- If at the main screen do the morph
--
if the frameLabel = "TOCM" then
myGo(theLabel)
else
goGo(theLabel & "M") -- just go there
end if
end goGOm
on returnFromHelp
global gReturnFromHelpFrame, gHelpStart, gHelpPalette, gFixPalShared
global gCom, gNavPalette
if gHelpStart + 60 > the ticks then exit
if the movie <> "STARMAP.DIR" then
tell gHelpPalette to lCloseHelpPalette
tell gHelpPalette to go to the frame - 2
end if
if the machineType <> 256 then
if voidP(gFixPalShared) then setupFixPal
gFixPalShared(mPatchIt)
end if
go to gReturnFromHelpFrame
if gCom then
tell gNavPalette to lOpenNavPalette
end if
end returnFromHelp
on doHelp
global gHelpPalette
global gReturnFromHelpFrame
global gHelpStart
global gFixPalShared, gNavPalette, gCom, gFiorellaOnStage
hideOverheadMenu
updateStage
if gFiorellaOnStage then stopHelp
if the movie = "TOUR.DIR" then stopTour
else if the movie = "MOVIES.DIR" then stopMovies
if the type of sprite 10 = 16 then
set cn = the castNum of sprite 10
if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
end if
if the movie = "FIND.DIR" and the frameLabel = "Glossary" then
set m = "_GLOSS.DIR"
set f = 1
else
set m = the movie
set f = the frameLabel
end if
set gReturnFromHelpFrame = the frame
if the movie <> "STARMAP.DIR" and voidP(gHelpPalette) then createHelpPalette
if the machineType <> 256 then
if voidP(gFixPalShared) then setupFixPal
gFixPalShared(mPatchIt)
end if
if gCom then
tell gNavPalette to lCloseNavPalette(1)
end if
if the movie <> "STARMAP.DIR" then
tell gHelpPalette to lOpenHelpPalette(m, f)
end if
set hLabel = label("Help Frame")
if hLabel <> 0 then
go to hLabel
else
go to the frame + 1
end if
set gHelpStart = the ticks
end doHelp
on hideSprites
repeat with i = 1 to 48
set the visibility of sprite i = 0
end repeat
end
on doQuit
global gCom, gNavPalette, gCurHist, gCurData, gGlossPalette
global gFiorellaOnStage
hideOverheadMenu
updateStage
if gFiorellaOnStage then stopHelp
if the movie = "TOUR.DIR" then stopTour
else if the movie = "MOVIES.DIR" then stopMovies
if the type of sprite 10 = 16 then
set cn = the castNum of sprite 10
if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
end if
if the movie = "FIND.DIR" and not voidP(gGlossPalette) then
tell gGlossPalette to lCloseGlossPalette
end if
if gCom then
tell gNavPalette to lCloseNavPalette(1)
set the visibility of sprite 22 = 0
set the visibility of sprite 23 = 0
set the visibility of sprite 24 = 0
set the visibility of sprite 25 = 0
go to objectLabel()
if gCurHist=0 then unGrayHist
if gCurData=0 then unGrayData
else
puppetTransition 52,8,8
end if
hideSprites 1,48
go to label("Black Frame")
fadeSoundChan(1)
go to movie "FINCREDS"
-- if gCom then
-- tell gNavPalette to lOpenNavPalette
-- set the visibility of sprite 22 = 1
-- set the visibility of sprite 23 = 1
-- set the visibility of sprite 24 = 1
-- set the visibility of sprite 25 = 1
-- end if
end doQuit
on doFind
global gCom, gNavPalette, gCurHist, gCurData, gFiorellaOnStage
--alert "TBD: Find"
hideOverheadMenu
updateStage
if gFiorellaOnStage then stopHelp
if the movie = "FIND.DIR" and the frameLabel <> "Glossary" then exit
if the movie = "TOUR.DIR" then stopTour(1)
else if the movie = "MOVIES.DIR" then stopMovies(1)
if the type of sprite 10 = 16 then
set cn = the castNum of sprite 10
if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
end if
if gCom then
if gCurHist=0 then unGrayHist
if gCurData=0 then unGrayData
go to objectLabel()
tell gNavPalette to lCloseNavPalette(1)
else
puppetTransition 52,8,8
end if
addToRetrace
--hideButtons
hideSprites 1,48
go to "Black Frame"
go to frame "Black Frame" of movie "FIND.DIR"
end doFind
on doGlossary
global gReturnFromGlossFrame, gReturnFromGlossMovie
global gFixPalShared, gGlossPalette, gGlossOffScreen
global gCom, gFiorellaOnStage
hideOverheadMenu
updateStage
if gFiorellaOnStage then stopHelp
if not voidP(gGlossOffScreen) and not gGlossOffScreen then exit
cursor 4
if the movie = "TOUR.DIR" then stopTour(1)
else if the movie = "MOVIES.DIR" then stopMovies(1)
if the type of sprite 10 = 16 then
set cn = the castNum of sprite 10
if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
end if
if (not gCom) and (the movie <> "FIND.DIR") then
addToRetrace
set gReturnFromGlossFrame = the frame
set gReturnFromGlossMovie = the movie
hideSprites 1,48
go to "black frame"
go to movie "SHOWGLOS.DIR"
end if
if voidP(gGlossPalette) then
createGlossPalette
end if
tell gGlossPalette to lOpenGlossPalette
cursor -1
end doGlossary
on AboutIUScreen
global gAboutGlobal, gReturnFromCredFrame, gReturnFromCredMovie, gCom, gNavPalette
global gCurHist, gCurData
hideOverheadMenu
updateStage
if the movie = "TOUR.DIR" then stopTour(1)
else if the movie = "MOVIES.DIR" then stopMovies(1)
if the type of sprite 10 = 16 then
set cn = the castNum of sprite 10
if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
end if
if gCom then
if gCurHist=0 then unGrayHist
if gCurData=0 then unGrayData
go to objectLabel()
tell gNavPalette to lCloseNavPalette(1)
else
puppetTransition 52,8,8
end if
set gAboutGlobal = 1
set gReturnFromCredFrame = the frame
set gReturnFromCredMovie = the movie
go to label("Black Frame")
if gCom then
set the visibility of sprite 22 = 0
set the visibility of sprite 23 = 0
set the visibility of sprite 24 = 0
set the visibility of sprite 25 = 0
end if
updateStage
fadeSoundChan(1)
go to movie "FINCREDS"
if gCom then
tell gNavPalette to lOpenNavPalette
set the visibility of sprite 22 = 1
set the visibility of sprite 23 = 1
set the visibility of sprite 24 = 1
set the visibility of sprite 25 = 1
end if
end AboutIUScreen